package com.java.array;

import java.util.Scanner;

public class ArrayDemo1 {
    public static void main(String[] args) {
        //二维数组保存成绩
        double[][] scores = new double[3][];

        //输入成绩，使用scanner
        Scanner scanner = new Scanner(System.in);

        for (int i = 0; i < scores.length; i++) {
            System.out.println("请输入第" + (i + 1) + "个班级的成员人数：");
            int count = scanner.nextInt();
            scores[i] = new double[count];
            for (int j = 0; j < scores[i].length; j++) {
                System.out.println("请输入第" + (i + 1) + "个班级的第" + (j + 1) +"个同学成绩：");
            }
        }

        for (int i = 0; i < scores.length; i++) {
            for (int j = 0; j < scores[i].length; j++) {
                System.out.println("第" + (i + 1) + "个班级的第" + (j + 1) + "个同学成绩为：" + scores[i][j]);
            }
        }

    }
}
